package com.fileshare.web.controller.admin.view;

import com.fileshare.web.controller.admin.BaseController;
import com.fileshare.web.dto.info.WebInfo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * 后端首页
 */
@Controller
@RequestMapping("/admin/home")
@PreAuthorize("@auth.matchAny('administrator')")
public class HomeAdminController extends BaseController {
    @GetMapping
    public String index(HttpServletRequest request) {
        WebInfo webInfo = new WebInfo();
        webInfo.setTitle("管理主页");
        request.setAttribute("webInfo", webInfo);
        return view("index/index");
    }
}
